﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoCooker2
{
    class AutoCooker2
    {
        private ICookerEvents _events;

        public AutoCooker2(ICookerEvents ps)
        {
            _events = ps;
        }

        public void DoCook()
        {
            Console.WriteLine("AutoCooker start to cook");
            if (_events != null) _events.CookStartedReply();

            Console.WriteLine("AutoCooker is cooking");
            if (_events != null) _events.CookProgressingReply();

            Console.WriteLine("AutoCooker finish to Cook");
            if (_events != null)
            {
                int grade = _events.CookCompletedReply();
                Console.WriteLine("My appetite is {0} %",grade);
            }
        }

    }
}
